<!-- 执行工单——区域表单填写 -->
<template>
  <px-tab-pane :label="label">
    <px-scrollbar ref="scrollbarRef" class="inspect-task-detail-content">
      <!-- <px-form ref="ruleFormRef" :scroll-to-error="true" :inline="false" :model="formValue" label-position="right" label-width="80px"> -->
      <EditDropDown v-if="data?.envContentDTOlist?.contentDTOList" dropdownTitle="环境巡检">
        <template v-slot:content>
          <InspectContent
            :data="data.envContentDTOlist"
            :list="data.envContentDTOlist.contentDTOList"
            type="env"
            :propsValue="[...propsValue, 'envContentDTOlist', 'contentDTOList']"
            v-bind:="$attrs"
          />
        </template>
      </EditDropDown>
      <EditDropDown v-if="data?.eqpContentDTOList" dropdownTitle="设备巡检">
        <template v-slot:content>
          <TitleDropDown
            v-for="(item, index) in data.eqpContentDTOList"
            :key="item.equipId"
            :index="index + 1"
            :dropdownTitle="`${item.eqpName}（${item.eqpId}）`"
            class="equip-row-100"
          >
            <template v-slot:content>
              <InspectContent
                v-model:formValue="formValue"
                :data="item"
                :eqpName="`${item.eqpName}（${item.eqpId}）`"
                :list="item.contentDTOList"
                type="eqp"
                :propsValue="[...propsValue, 'eqpContentDTOList', index, 'contentDTOList']"
                v-bind:="$attrs"
              />
            </template>
          </TitleDropDown>
        </template>
      </EditDropDown>
      <!-- </px-form> -->
    </px-scrollbar>
  </px-tab-pane>
</template>
<script setup lang="ts">
import EditDropDown from "@/views/all/equip/components/EditDropDown.vue";
import { ref, watch, nextTick } from "vue";
import TitleDropDown from "../../components/TitleDropDown.vue";
import InspectContent from "./InspectContent.vue";
const props = defineProps(["data", "label", "propsValue", "activeTab"]);
const formValue = ref({ fileList: [], summary: "" });
const scrollbarRef = ref();
watch(
  () => props.activeTab,
  () => {
    nextTick(() => {
      scrollbarRef.value!.setScrollTop(0);
    });
  }
);
</script>
<style lang="scss" scoped>
.equip-row-100 {
  width: 100%;
}
</style>
